load("//tools:defs.bzl", "go_library", "go_test")

package(
    default_applicable_licenses = ["//:license"],
    licenses = ["notice"],
)

go_library(
    name = "sandbox",
    srcs = [
        "memory.go",
        "network.go",
        "network_unsafe.go",
        "sandbox.go",
        "xdp.go",
    ],
    visibility = [
        "//runsc:__subpackages__",
        "//test:__subpackages__",
    ],
    deps = [
        "//pkg/abi/linux",
        "//pkg/atomicbitops",
        "//pkg/cleanup",
        "//pkg/control/client",
        "//pkg/control/server",
        "//pkg/coverage",
        "//pkg/fd",
        "//pkg/log",
        "//pkg/metric:metric_go_proto",
        "//pkg/prometheus",
        "//pkg/sentry/control",
        "//pkg/sentry/devices/nvproxy",
        "//pkg/sentry/fsimpl/erofs",
        "//pkg/sentry/platform",
        "//pkg/sentry/seccheck",
        "//pkg/state/statefile",
        "//pkg/sync",
        "//pkg/tcpip/header",
        "//pkg/tcpip/stack",
        "//pkg/urpc",
        "//pkg/xdp",
        "//runsc/boot",
        "//runsc/boot/procfs",
        "//runsc/cgroup",
        "//runsc/config",
        "//runsc/console",
        "//runsc/donation",
        "//runsc/sandbox/bpf",
        "//runsc/specutils",
        "//tools/xdp/cmd",
        "@com_github_cenkalti_backoff//:go_default_library",
        "@com_github_cilium_ebpf//:go_default_library",
        "@com_github_cilium_ebpf//link:go_default_library",
        "@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
        "@com_github_syndtr_gocapability//capability:go_default_library",
        "@com_github_vishvananda_netlink//:go_default_library",
        "@org_golang_x_sys//unix:go_default_library",
    ],
)

go_test(
    name = "sandbox_test",
    size = "small",
    srcs = ["memory_test.go"],
    library = ":sandbox",
)
